<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css" />
		<link rel="stylesheet" type="text/css" href="css/app.css" />
		
		<style type="text/css">
			input{
				width: 100%;
				line-height: 28px;
			}
		</style>
	</head>

	<body>
		<div class="mui-content">

			<div class="mui-card">
				<div class="mui-row" style="line-height: 28px;">
					<div class="mui-col-xs-3 hmx-text-darkgray2 mui-text-center" style="color: black;">
						手机号
					</div>
					<div class="mui-col-xs-9">
						<input class="hmx-text-darkgray2" name="" id="TELPHONE" value="" placeholder="" />
					</div>
				</div>
			</div>

			<div class="mui-card">
				<div class="mui-row" style="line-height: 28px;">
					<div class="mui-col-xs-3 hmx-text-darkgray2 mui-text-center" style="color: black;">
						邮箱
					</div>
					<div class="mui-col-xs-9">
						<input class="hmx-text-darkgray2" name="" id="USEREMAIL" value="" placeholder="" />
					</div>
				</div>
			</div>

			<div class="mui-card">
				<div class="mui-row" style="line-height: 28px;">
					<div class="mui-col-xs-3 hmx-text-darkgray2 mui-text-center" style="color: black;">
						所在学校
					</div>
					<div class="mui-col-xs-9">
						<input class="hmx-text-darkgray2" name="" id="SCHOOL" value="" placeholder="" />
					</div>
				</div>
			</div>
			
			<div class="mui-card">
				<div class="mui-row" style="line-height: 28px;">
					<div class="mui-col-xs-3 hmx-text-darkgray2 mui-text-center" style="color: black;">
						性别
					</div>
					<div class="mui-col-xs-9">
						<input class="hmx-text-darkgray2" name="" id="SEX" value="" placeholder="" />
					</div>
				</div>
			</div>
			
			<div class="mui-card">
				<div class="mui-row" style="line-height: 28px;">
					<div class="mui-col-xs-3 hmx-text-darkgray2 mui-text-center" style="color: black;">
						城市
					</div>
					<div class="mui-col-xs-9">
						<input class="hmx-text-darkgray2" name="" id="CITY" value="" placeholder="" />
					</div>
				</div>
			</div>
			
			<div class="mui-card">
				<div class="mui-row" style="line-height: 28px;">
					<div class="mui-col-xs-3 hmx-text-darkgray2 mui-text-center" style="color: black;">
						年龄
					</div>
					<div class="mui-col-xs-9">
						<input class="hmx-text-darkgray2" name="" id="USERAGE" value="" placeholder="" />
					</div>
				</div>
			</div>

			<button onclick="mSubmit()" type="button" class="mui-btn mui-btn-block hmx-btn-orange hmx-btn-lg" style="margin: 60px 12px 0 12px;width: -webkit-calc(100% - 24px);">保存修改 </button>
		</div>
		<script src='js/jquery-2.1.4.min.js'></script>
		<script src="js/mui.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/common.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			mui.init();
			$(function() {
				initUI();
			});

			function initUI() {
				$.ajax({
					type: "get",
					url: $.getContextPath() + "/weixin/getClientUser",
					async: true,
					success: function(r) {
						r = eval('(' + r + ')');
						$('#TELPHONE').val(r.data['TELPHONE']);
						$('#USEREMAIL').val(r.data['USEREMAIL']);
						$('#SCHOOL').val(r.data['SCHOOL']);
						
						$('#SEX').val(r.data['SEX']);
						$('#CITY').val(r.data['CITY']);
						$('#USERAGE').val(r.data['USERAGE']);
					}
				});
			};

			function mSubmit() {
				$.ajax({
					type: "get",
					url: $.getContextPath() + "/weixin/updateClientUser",
					async: true,
					data: {
						TELPHONE: $('#TELPHONE').val(),
						USEREMAIL: $('#USEREMAIL').val(),
						SCHOOL: $('#SCHOOL').val(),
						
						SEX: $('#SEX').val(),
						CITY: $('#CITY').val(),
						USERAGE: $('#USERAGE').val(),
					},
					success: function(r) {
						alert('保存成功！');
						window.history.go(-1);
//						window.location=document.referrer;
//						location.reload(); 
					}
				});
			};
		</script>
	</body>

</html>